

list = [2, 54, 324, 46, 21, 1, 6]

def quick(qlist):
    if len(qlist) <= 1:
        return qlist
    else:
        qa = qlist[0]
        qb = quick([l for l in qlist[1:] if l < qa])
        qc = quick([m for m in qlist[1:] if m >= qa])
        return qb + [qa] + qc


print(quick(list))